import facebook from "@/components/j-svg/facebook.vue";
import twitter from "@/components/j-svg/twitter.vue";
import telegram from "@/components/j-svg/telegram.vue";

import Jtwitter from "@/assets/svg/twitter.svg";
import Jfacebook from "@/assets/svg/facebook.svg";
import Jtelegram from "@/assets/svg/telegram.svg";
import Jreddit from "@/assets/svg/reddit.svg";
import Jwhatsapp from "@/assets/svg/whatsapp.svg";
import Jlink from "@/assets/svg/link.svg";
import { useUser } from "@/stores/user";
import i18n from "@/locals";
import { markRaw, reactive } from "vue";


const ShareConfig = {
    icon: '',//图标
    tags: "vuejs,vite",//标签
    title: "Say hi to Vite! A brand new, extremely fast development setup for Vue.",//标题
    link: "https://news.vuejs.org/issues/180",//链接
    label: "Twitter",
    description: `This week, I’d like to introduce you to 'Vite', which means 'Fast'. It’s a brand new development setup created by Evan You.`,//描述
    quote: ""
};

enum Platform {
    TWITTER = 'Twitter',
    FACEBOOK = 'Facebook',
    TELEGRAM = 'Telegram'
}
const shareTags = "ChainingView"
class Share<T> {
    icon: T;
    network: Platform;
    url: string;
    title: string;
    hashtags: string;
    description: string;

    constructor(icon: T, platform: Platform) {
        this.network = platform;
        this.icon = icon;
        this.url = location.href;
        this.hashtags = "ChainingView"
        this.title = "";
        this.description = "";
    }
}

class ShareItem<T> extends Share<T> {
    constructor(icon: T, platform: Platform) {
        super(icon, platform);
    }
    setIcon(icon: T) {
        this.icon = icon;
        return this;
    }
    setNetwork(network: Platform) {
        this.network = network;
        return this;
    }
    setUrl(url: string) {
        this.url = url;
        return this;
    }
    setTitle(title: string) {
        this.title = title;
        return this;
    }
    setDescription(description: string) {
        this.description = description;
        return this;
    }
    setHashtags(hashtags: string) {
        this.hashtags = hashtags;
        return this;
    }
}

const Yshare = reactive([
    // new ShareItem<any>(facebook, Platform.FACEBOOK),
    new ShareItem<any>(markRaw(twitter), Platform.TWITTER),
    new ShareItem<any>(markRaw(telegram), Platform.TELEGRAM),
]);

const Jshare = reactive([
    [
        // new ShareItem<any>(Jtwitter, Platform.FACEBOOK),
        new ShareItem<any>(Jtwitter, Platform.TWITTER),
        new ShareItem<any>(Jtelegram, Platform.TELEGRAM),
    ],
    // [
    //     new ShareItem<any>(Jreddit, Platform.TELEGRAM),
    //     new ShareItem<any>(Jwhatsapp, Platform.TELEGRAM),
    //     new ShareItem<any>(Jlink, Platform.TELEGRAM),
    // ]
]);
export { ShareConfig, ShareItem, Platform, Yshare, Jshare,shareTags };